from rest_framework import viewsets
from rest_framework.response import Response
from rest_framework.decorators import action
from .models import MedicineCategory, Medicine, MyMedicine, ScanRecord
from .serializers import MedicineCategorySerializer, MedicineSerializer, MyMedicineSerializer, ScanRecordSerializer

class MedicineCategoryViewSet(viewsets.ModelViewSet):
    queryset = MedicineCategory.objects.all()
    serializer_class = MedicineCategorySerializer

class MedicineViewSet(viewsets.ModelViewSet):
    queryset = Medicine.objects.all()
    serializer_class = MedicineSerializer

class MyMedicineViewSet(viewsets.ModelViewSet):
    queryset = MyMedicine.objects.all()
    serializer_class = MyMedicineSerializer

class ScanRecordViewSet(viewsets.ModelViewSet):
    queryset = ScanRecord.objects.all()
    serializer_class = ScanRecordSerializer